import { SUCCESS_CODE } from '@/constants'

const timeout = 1000

const data = {
  username: 'admin',
  password: 'admin',
  role: 'admin',
  roleId: '1',
  permissions: ['*.*.*']
}

export default [
  // 登录接口
  {
    url: '/mock/user/login',
    method: 'post',
    timeout,
    response: ({ body }) => {
      console.log(body);
      return {
        code: SUCCESS_CODE,
        data: data
      }
    }
  },
  // 退出接口
  {
    url: '/mock/user/loginOut',
    method: 'get',
    timeout,
    response: () => {
      return {
        code: SUCCESS_CODE,
        data: null
      }
    }
  }
]
